//
//  JMPickerDate.h
//  NbTest
//
//  Created by admin on 12-3-9.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//
/*
 1单例需要在程序退出时 调用delocateInstance 确保释放内存
 直接使用类函数PopViewWithYYString来弹出显示
 */

#import <Foundation/Foundation.h>
#import "SheetViewController.h"

//@protocol JMPickerDateDelegate <NSObject>
//-(void) didSeletedDateStr:(NSString*) aStrDate;
//@end


@interface JMPickerDate : NSObject
{
    UILabel* _titleLabel;
    
    UIActionSheet* _actionSheet;
    UIDatePicker*  _pickerDate;
    
    UITableView* _tableView;
    NSMutableString*   _YYSelString;//传出参数 引用

}

@property(nonatomic, retain) NSString*   _YYSelString;//传入参数
@property(nonatomic, retain) UITableView* _tableView;
@property (nonatomic, retain)SheetViewController* sheetVC;

@property(nonatomic, retain) UIActionSheet* _actionSheet;
@property(nonatomic, retain) UIDatePicker*  _pickerDate;
@property(nonatomic, retain) UILabel* _titleLabel;
@property (nonatomic, assign) id<JMPickerDateDelegate> iDelegate;




  /*
   1类方法 PopViewWithYYString
   2aString 传出参数 引用
   3 aView  此弹出窗口将显示在 aView上 ； 并且在点击确定后 调用aView的reloaddata
   */


+(void)PopViewWithYYString:(NSMutableString*)aString andIn:(UITableView*) aView andTitle:(NSString*) aTitle;//弹出日期选择
//带delegate
+(void)PopViewWithYYString:(NSMutableString*)aString andIn:(UITableView*) aView andTitle:(NSString*) aTitle  with:(id<JMPickerDateDelegate>) aDelegate;

+ (id) getInstance;
+ (void) delocateInstance;


-(void)selectDateAffirm;//日期确定
-(void)selectDateCanceled;//日期取消

//不属于这个类的方法 暂时放这里 用于获得前n个月的日期
+(NSDate *)getPriousDateFromDate:(NSDate *)date withMonth:(int)month;
+(NSString *)getStrPriousDateFromDate:(NSDate *)date withMonth:(int)month;
+(NSString *)getStrPriousDateFromStr:(NSString *)strDate withMonth:(int)month;

@end
